<template>
	<view>
		<view class="map" style="height: 350rpx;width: 100%;margin-top: 10rpx;">
			<map :id="maps" :markers="markers" style="width: 100%;height: 100%;" @tap="tapMap"></map>
		</view>
			
		</view>
	</view>
</template>
<script>
	import Amap from './js/lyn4ever-gaode.js';
	export default {
			data() {
				return {
					
					longitude: 104.050184,
					latitude: 30.68989,
					markers: [],
					polyline: [],
					maps: 1,
					
				}
			},
			onLoad() {
				let that = this;
				var startPoi = "104.07231,30.663467";
				var wayPoi ="104.07231,30.663467;104.050184,30.68989"
				var endPoi = "104.050184,30.68989";
				
				Amap.line(startPoi, endPoi,function(res){
					that.polyline.push(res)
				});
			
				Amap.markers(startPoi,endPoi,function(res){
					that.markers.push.apply(that.markers,res)
				})
			},
			methods: {
				tapMap(e) {
					var that = this;
					var id = e.currentTarget.id;
					var maps = uni.createMapContext(id, this).$getAppMap();
	
				}
			}
		}

</script>


<style lang="scss">
	
</style>
